<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8" />
    <title>上传附件简历</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1" name="viewport" />
    <link href="css/base.css" rel="stylesheet" type="text/css" />
    <link href="css/button.css" rel="stylesheet" type="text/css" />
    <link href="css/icon.css" rel="stylesheet" type="text/css" />
    <link href="css/attachment.css" rel="stylesheet" type="text/css" />
</head>

<body>
    <div id="container" class="upload">
        <div id="pickfile" class="upload-btn">
            上传附件简历
        </div>
    </div>
    <a href="javascript:;" class="btn btn-submit sbm yellow">提交</a>
    <script src="js/jquery.min.js" type="text/javascript"></script>
    <script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js" type="text/javascript"></script>
    <script src="js/template.js" type="text/javascript"></script>
    <script src="js/plupload.full.min.js" type="text/javascript"></script>
    <script src="js/qiniu.min.js" type="text/javascript"></script>
    <script src="js/base.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function() {
            bee.wxConfig(function() {
                bee.hideAllNonBaseMenuItem();
            }, function(res) {});

            var url = '';
            bee.request({
                url: '/Index/Index/get_qiniu',
                data: null,
                success: function(result) {
                    var uploader = Qiniu.uploader({
                        runtimes: 'html5,flash,html4',
                        browse_button: 'pickfile',
                        container: 'container',
                        drop_element: 'container',
                        max_file_size: '100mb',
                        flash_swf_url: 'swf/Moxie.swf',
                        dragdrop: true,
                        chunk_size: '4mb',
                        uptoken: result.token,
                        domain: 'sugray.com',
                        auto_start: true,
                        // unique_names: false,
                        // save_key: false,
                        init: {
                            'FileUploaded': function(up, file, info) {
                                info = JSON.parse(info);
                                url = bee.link.image + '/' + info.key;
                                $('#pickfile').text('已上传成功（可选择重传）');
                            },
                            'Key': function(up, file) {
                                var key = new Date().getTime();
                                return key + '.' + file.name.split('.')[1];
                            }
                        }
                    });
                }
            });

            $('body').on('click', '.sbm', function() {
                var data = {};
                data.id = bee.getQueryString('id');
                data.url = url;
                bee.request({
                    url: '/Index/Hr/add',
                    data: data,
                    success: function(result) {
                        bee.open('index.html');
                    }
                });
            });
        });
    </script>
</body>

</html>
